# -*- coding:utf-8 -*-
import cv2 as cv
import numpy as np
 
src = cv.imread('C:/Git/raspi-S1/Pic/test1.jpg')
path = r'C:/Git/raspi-S1/Pic/'
 
def face_detect_demo():
  gray = cv.cvtColor(src,cv.COLOR_BGR2GRAY)
 
  face_detector = cv.CascadeClassifier('haarcascade_frontalface_default.xml')
  face_detector.load(path + '\haarcascade_frontalface_default.xml')
  faces = face_detector.detectMultiScale(gray,1.3,5)
  for x,y,w,h in faces:
    cv.rectangle(src,(x,y),(x+w,y+h),(0,0,255),2)
  cv.imshow("result",src)
 
print("--------------python face detect-------------")
cv.namedWindow("input image",0)
cv.namedWindow("result",0)
cv.imshow("input image",src)
#face_detect_demo()
cv.waitKey(0)
cv.destroyAllWindows()